import http from "@/common/http/request";
import {
  musicSongCategoryListInterface,
  musicSongCategoryAddInterface,
  musicSongCategoryUpdateInterface,
} from "./songCategory.interface";
// 曲谱分类列表
export const $musicSongCategoryList = (data: musicSongCategoryListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/music/SongCategory/list',
    data,
  })
}

//歌曲分类树
export const $songCategoryListTree = (data?: { status?: number }) => {
  const $http = new http();
  return $http.get({
    url: '/music/SongCategory/list-tree',
    data,
  })
}

//新增分类
export const $songCategoryAdd = (data: musicSongCategoryAddInterface) => {
  const $http = new http();
  return $http.post({
    url: '/music/SongCategory',
    data,
  })
}

//删除分类
export const $songCategoryDelete = (data: Array<string>) => {
  const $http = new http();
  return $http.delete({
    url: `/music/SongCategory/${data.join(',')}`,
  })
}

//更新分类
export const $songCategoryUpdate = (data: musicSongCategoryUpdateInterface) => {
  const $http = new http();
  return $http.put({
    url: '/music/SongCategory',
    data,
  })
}

//分类详情
export const $songCategoryDetail = (data: string) => {
  const $http = new http();
  return $http.get({
    url: `/music/SongCategory/${data}`,
  })
}